﻿using System.Text.Json.Serialization;
using Newtonsoft.Json;

namespace fCloud.SensorApi.Models;

// 主响应容器类
public class ApiResponse
{
    [JsonProperty("data")]
    public List<NodeData> Data { get; set; }

    [JsonProperty("meta")]
    public MetaInfo Meta { get; set; }
}

// 节点数据类
public class NodeData
{
    [JsonProperty("inflight_cnt")] public int InflightCount { get; set; }
    
    [JsonProperty("zone")] public string Zone { get; set; }
    
    [JsonProperty("proto_ver")] public int ProtocolVersion { get; set; }
    
    [JsonProperty("send_oct")] public long SendOctets { get; set; }
    
    [JsonProperty("recv_msg.dropped")] public int ReceivedMessagesDropped { get; set; }
    
    [JsonProperty("ip_address")] public string IpAddress { get; set; }
    
    [JsonProperty("mqueue_len")] public int MessageQueueLength { get; set; }
    
    [JsonProperty("clientid")] public string ClientId { get; set; }
    
    [JsonProperty("enable_authn")] public bool AuthenticationEnabled { get; set; }
    
    [JsonProperty("recv_cnt")] public int ReceivedCount { get; set; }
    
    [JsonProperty("recv_msg.qos2")] public int ReceivedQos2Messages { get; set; }
    
    [JsonProperty("send_msg.dropped.too_large")] public int SentMessagesDroppedTooLarge { get; set; }
    
    [JsonProperty("is_bridge")] public bool IsBridge { get; set; }
    
    [JsonProperty("awaiting_rel_cnt")] public int AwaitingReleaseCount { get; set; }
    
    [JsonProperty("connected")] public bool Connected { get; set; }
    
    [JsonProperty("send_pkt")] public int SentPackets { get; set; }
    
    [JsonProperty("send_msg.qos1")] public int SentQos1Messages { get; set; }
    
    [JsonProperty("recv_pkt")] public int ReceivedPackets { get; set; }
    
    [JsonProperty("send_msg.dropped.expired")] public int SentMessagesExpired { get; set; }
    
    [JsonProperty("recv_msg.qos0")] public int ReceivedQos0Messages { get; set; }
    
    [JsonProperty("awaiting_rel_max")] public int MaxAwaitingReleases { get; set; }
    
    [JsonProperty("username")] public string Username { get; set; }
    
    [JsonProperty("send_msg.dropped")] public int SentMessagesDropped { get; set; }
    
    [JsonProperty("send_msg.qos0")] public int SentQos0Messages { get; set; }
    
    [JsonProperty("send_msg.dropped.queue_full")] public int SentMessagesDroppedQueueFull { get; set; }
    
    [JsonProperty("inflight_max")] public int MaxInflightMessages { get; set; }
    
    [JsonProperty("connected_at")] public DateTime ConnectedAt { get; set; }
    
    [JsonProperty("send_msg.qos2")] public int SentQos2Messages { get; set; }
    
    [JsonProperty("reductions")] public long Reductions { get; set; }
    
    [JsonProperty("is_persistent")] public bool IsPersistent { get; set; }
    
    [JsonProperty("recv_msg.dropped.await_pubrel_timeout")] 
    public int ReceivedMessagesDroppedAwaitingPubrelTimeout { get; set; }
    
    [JsonProperty("mqueue_max")] public int MessageQueueMax { get; set; }
    
    [JsonProperty("recv_msg")] public int ReceivedMessages { get; set; }
    
    [JsonProperty("recv_oct")] public long ReceivedOctets { get; set; }
    
    [JsonProperty("created_at")] public DateTime CreatedAt { get; set; }
    
    [JsonProperty("proto_name")] public string ProtocolName { get; set; }
    
    [JsonProperty("send_msg")] public int SentMessages { get; set; }
    
    [JsonProperty("clean_start")] public bool CleanStart { get; set; }
    
    [JsonProperty("listener")] public string Listener { get; set; }
    
    [JsonProperty("subscriptions_cnt")] public int SubscriptionsCount { get; set; }
    
    [JsonProperty("keepalive")] public int KeepAlive { get; set; }
    
    [JsonProperty("mailbox_len")] public int MailboxLength { get; set; }
    
    [JsonProperty("subscriptions_max")] public string SubscriptionsMax { get; set; }
    
    [JsonProperty("send_cnt")] public int SentCount { get; set; }
    
    [JsonProperty("node")] public string Node { get; set; }
    
    [JsonProperty("recv_msg.qos1")] public int ReceivedQos1Messages { get; set; }
    
    [JsonProperty("mqueue_dropped")] public int MessageQueueDropped { get; set; }
    
    [JsonProperty("heap_size")] public int HeapSize { get; set; }
    
    [JsonProperty("port")] public int Port { get; set; }
    
    [JsonProperty("mountpoint")] public object MountPoint { get; set; }
    
    [JsonProperty("expiry_interval")] public int ExpiryInterval { get; set; }
}

// 元信息类
public class MetaInfo
{
    [JsonProperty("count")] public int TotalCount { get; set; }
    [JsonProperty("limit")] public int Limit { get; set; }
    [JsonProperty("page")] public int Page { get; set; }
}